<?php
class AdminUserLogin{
	public function run($app){
		if(!isset($_SESSION['adminuid']) OR $_SESSION['adminuid'] < 1){
			if($app->Control != 'user' AND $app->Action != 'login'){
				header(sprintf("Location: %s/user/login",$app->BasePath));
				die();
			}
		}else{
			if($app->Control == 'user' AND $app->Action == 'login'){
				header(sprintf("Location: %s/index/index",$app->BasePath));
				die();
			}
		}
	}
}